package com.jsu.springboot_medicine.service.impl;

import com.jsu.springboot_medicine.dao.ReportDao;
import com.jsu.springboot_medicine.entity.Report;
import com.jsu.springboot_medicine.service.ReportService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * @author js
 * @name ReportServiceImpl
 * @Date 2023/10/2 19:58
 */
@Service
public class ReportServiceImpl implements ReportService {
    @Resource
    private ReportDao reportDao;
    @Override
    public List<Report> selectAll() {
        return reportDao.selectAll();
    }

    @Override
    public List<Report> selectAllById(int reporterId) {
        return reportDao.selectAllById(reporterId);
    }

    @Override
    public int delete(int id) {
        return reportDao.delete(id);
    }

    @Override
    public int insert(Report report) {
        report.setReportDate(new Date());
        return reportDao.insert(report);
    }
}
